#ifndef RCDATA_H_INCLUDED
#define RCDATA_H_INCLUDED

#include <list>
#include "types.h"
#include "image.h"

using namespace std;

class CriticalRegion{

    public:
    enum RegionType{
        BIFURCATION,
        CROSSING,
        SUPERPOSITION,
        NONE
    };
    typedef enum RegionType RegionType;

    private:
    int label;
    list<Position> regionpoints;
    RegionType type;
    RegionType forcedtype;
    unsigned int emergentvectors;


    public:
    CriticalRegion();


    void setType(RegionType type);
    void setLabel(int label);
    void forceType(RegionType forcedtype);
    void set_emergent_vec(unsigned int nvectors);
    void addPoint(Position position);

    CriticalRegion::RegionType getType();
    int getLabel();
    CriticalRegion::RegionType getforcedType();
    int get_emergent_vec();
    list<Position> getPoints();

};


class RCData{
    private:
    Grey_Image* rclabelling;
    list<CriticalRegion> data;
    int nregion;

    public:
    RCData(unsigned int imageheight,unsigned int imagewidth);
    ~RCData();

    void addRegion(CriticalRegion newregion);
    Grey_Image* getImage();

    int getnregion();

    void forceclassification(Position xy,CriticalRegion::RegionType type);
    CriticalRegion::RegionType getforcedclassification(Position xy);
    CriticalRegion::RegionType getforcedclassification(int label);

};

#endif // RCDATA_H_INCLUDED
